<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/TR/xhtml1/strict">
<head>
<title>Configuration in the Tomcat</title>
<meta content="1999-2002 The Apache Software Foundation" name="copyright"/>
<meta content="$Date: 2002/09/20 21:35:31 $" name="last-changed"/>
<meta content="Jean-Frederic Clere" name="author"/>
<meta content="jfrederic.clere@fujitsu-siemens.com" name="email"/>
<link href="..//style.css" type="text/css" rel="stylesheet"/>
<link href="../images/tomcat.ico" rel="shortcut icon"/>
</head>
<body link="#525D76" vlink="#525D76" alink="#525D76" text="#000000" bgcolor="#ffffff">
<a name="TOP"/>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr height="1">
<td class="nil" height="1" bgcolor="#ffffff" width="150">
<img hspace="0" vspace="0" height="1" width="150" border="0" src="../images/pixel.gif"/>
</td>
<td class="nil" height="1" bgcolor="#ffffff" width="*">
<img hspace="0" vspace="0" height="1" width="370" border="0" src="../images/pixel.gif"/>
</td>
</tr>
<tr>
<td width="*" colspan="2" class="logo" bgcolor="#ffffff">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="left">
<img align="left" height="75" width="270" border="0" src="../images/jakarta.gif"/>
</td>
<td align="right">
<img align="right" border="0" src="../images/mod_jk.jpeg"/>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2" width="*" align="right" class="head" bgcolor="#999999">
<nobr>
<a href="http://www.apache.org/" class="head">Apache Software Foundation</a> |
                <a href="http://jakarta.apache.org/" class="head">Jakarta Project</a> |
                <a href="http://jakarta.apache.org/tomcat/" class="head">Apache Tomcat</a>
</nobr>
</td>
</tr>
<tr>
<td valign="top" width="150" bgcolor="#ffffff">
<table class="menu" cellpadding="0" cellspacing="0" width="150" border="0">
<tr height="1">
<td class="nil" height="1" bgcolor="#cccccc" width="10">
<img hspace="0" vspace="0" height="1" width="10" border="0" src="../images/pixel.gif"/>
</td>
<td class="nil" height="1" bgcolor="#cccccc" width="140">
<img hspace="0" vspace="0" height="1" width="140" border="0" src="../images/pixel.gif"/>
</td>
</tr>
<tr height="6">
<td colspan="2" width="150" bgcolor="#d0d0d0">Presentation</td>
</tr>
<tr>
<td colspan="2" width="150" bgcolor="#cccccc">
<nobr>
<a class="menu" href="../index.html">Overview</a>
</nobr>
</td>
</tr>
<tr height="2"/>
<tr height="6"/>
<tr height="6">
<td colspan="2" width="150" bgcolor="#d0d0d0">Commons</td>
</tr>
<tr>
<td colspan="2" width="150" bgcolor="#cccccc">
<nobr>
<a class="menu" href="../common/AJPv13.html">AJPv13</a>
</nobr>
</td>
</tr>
<tr height="2"/>
<tr>
<td colspan="2" width="150" bgcolor="#cccccc">
<nobr>
<a class="menu" href="../common/AJPv14-proposal.html">AJPv14 Proposal</a>
</nobr>
</td>
</tr>
<tr height="2"/>
<tr>
<td colspan="2" width="150" bgcolor="#cccccc">
<nobr>
<a class="menu" href="../faq.html">FAQ</a>
</nobr>
</td>
</tr>
<tr height="2"/>
<tr height="6"/>
<tr height="6">
<td colspan="2" width="150" bgcolor="#d0d0d0">JK</td>
</tr>
<tr>
<td colspan="2" width="150" bgcolor="#cccccc">
<nobr>
<a class="menu" href="../jk/aphowto.html">Apache HowTo</a>
</nobr>
</td>
</tr>
<tr height="2"/>
<tr>
<td colspan="2" width="150" bgcolor="#cccccc">
<nobr>
<a class="menu" href="../jk/domhowto.html">Domino HowTo</a>
</nobr>
</td>
</tr>
<tr height="2"/>
<tr>
<td colspan="2" width="150" bgcolor="#cccccc">
<nobr>
<a class="menu" href="../jk/iishowto.html">IIS HowTo</a>
</nobr>
</td>
</tr>
<tr height="2"/>
<tr>
<td colspan="2" width="150" bgcolor="#cccccc">
<nobr>
<a class="menu" href="../jk/neshowto.html">Netscape/iPlanet HowTo</a>
</nobr>
</td>
</tr>
<tr height="2"/>
<tr>
<td colspan="2" width="150" bgcolor="#cccccc">
<nobr>
<a class="menu" href="../jk/workershowto.html">Workers HowTo</a>
</nobr>
</td>
</tr>
<tr height="2"/>
<tr height="6"/>
<tr height="6">
<td colspan="2" width="150" bgcolor="#d0d0d0">JK2</td>
</tr>
<tr>
<td colspan="2" width="150" bgcolor="#cccccc">
<nobr>
<a class="menu" href="../jk2/configtc.html">Configuration in the Tomcat</a>
</nobr>
</td>
</tr>
<tr height="2"/>
<tr>
<td width="10" bgcolor="#cccccc"/>
<td width="140" bgcolor="#cccccc">
<a href="#Intro" class="menu">Intro</a>
</td>
</tr>
<tr height="1"/>
<tr>
<td width="10" bgcolor="#cccccc"/>
<td width="140" bgcolor="#cccccc">
<a href="#Config options" class="menu">Config options</a>
</td>
</tr>
<tr height="1"/>
<tr>
<td width="10" bgcolor="#cccccc"/>
<td width="140" bgcolor="#cccccc">
<a href="#Examples" class="menu">Examples</a>
</td>
</tr>
<tr height="1"/>
<tr>
<td colspan="2" width="150" bgcolor="#cccccc">
<nobr>
<a class="menu" href="../jk2/configweb.html">Configuration in the Web Server</a>
</nobr>
</td>
</tr>
<tr height="2"/>
<tr height="6"/>
<tr height="6">
<td colspan="2" width="150" bgcolor="#d0d0d0">
                Developpers
                </td>
</tr>
<tr>
<td colspan="2" width="150" bgcolor="#cccccc">
<nobr>
<a href="./api-java/index.html" class="menu">Java API Documentation</a>
</nobr>
</td>
</tr>
<tr>
<td colspan="2" width="150" bgcolor="#cccccc">
<nobr>
<a href="./api-c/" class="menu">C API Documentation</a>
</nobr>
</td>
</tr>
</table>
</td>
<td class="body" valign="top" width="*" bgcolor="#ffffff">
<a name="Intro">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="left" valign="top" class="section" bgcolor="#525D76">
<img border="0" vspace="0" hspace="0" align="left" valign="top" src="../images/corner.gif"/>Intro</td>
</tr>
</table>
</a>
<p class="section">
  This document describes the configuration file used by mod_jk2 on the
  Tomcat site. Its default name is ${jkHome}/conf/jk2.properties,
  where ${jkHome} is the well known ${catalina.base} property.
</p>
<br/>
<a name="Config options">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="left" valign="top" class="section" bgcolor="#525D76">
<img border="0" vspace="0" hspace="0" align="left" valign="top" src="../images/corner.gif"/>Config options</td>
</tr>
</table>
</a>
<p class="section">
<table border="0">
<tr>
<td align="middle" valign="top" bgcolor="#039acc">Property name</td>
<td align="middle" valign="top" bgcolor="#039acc">Default</td>
<td align="middle" valign="top" bgcolor="#039acc">Description</td>
</tr>
<tr>
<td align="left" valign="top" bgcolor="#a0ddf0">handler.list</td>
<td align="left" valign="top" bgcolor="#a0ddf0">request,container,channelSocket</td>
<td align="left" valign="top" bgcolor="#a0ddf0">Handlers to load.</td>
</tr>
<tr>
<td align="left" valign="top" bgcolor="#a0ddf0">class.myhandler</td>
<td align="left" valign="top" bgcolor="#a0ddf0">No default value</td>
<td align="left" valign="top" bgcolor="#a0ddf0">Define the class of the handler myhandler.</td>
</tr>
<tr>
<td align="middle" valign="top" bgcolor="#039acc" colspan="2">apr</td>
<td align="left" valign="top" bgcolor="#a0ddf0">APR descriptor</td>
</tr>
<tr>
<td align="left" valign="top" bgcolor="#a0ddf0">NativeSo</td>
<td align="left" valign="top" bgcolor="#a0ddf0">jkjni</td>
<td align="left" valign="top" bgcolor="#a0ddf0">
    Location of the jkjni dynamic library.
    It is searched in java.library.path but a absolute path can be specified.
  </td>
</tr>
<tr>
<td align="left" valign="top" bgcolor="#a0ddf0">jniModeSo</td>
<td align="left" valign="top" bgcolor="#a0ddf0">inprocess</td>
<td align="left" valign="top" bgcolor="#a0ddf0">
    If set to "inprocess" the jk2 will regiter native library functions by itself.
	If not then it has to be the absolute path of the jkjni dynamic library.
  </td>
</tr>
<tr>
<td align="middle" valign="top" bgcolor="#039acc" colspan="2">channelSocket</td>
<td align="left" valign="top" bgcolor="#a0ddf0">A communication transport from a remote Web Server.</td>
</tr>
<tr>
<td align="left" valign="top" bgcolor="#a0ddf0">port</td>
<td align="left" valign="top" bgcolor="#a0ddf0">8009</td>
<td align="left" valign="top" bgcolor="#a0ddf0">First port where Tomcat is listening</td>
</tr>
<tr>
<td align="left" valign="top" bgcolor="#a0ddf0">address</td>
<td align="left" valign="top" bgcolor="#a0ddf0">127.0.0.1</td>
<td align="left" valign="top" bgcolor="#a0ddf0">Local address where Tomcat is listening.</td>
</tr>
<tr>
<td align="left" valign="top" bgcolor="#a0ddf0">maxPort</td>
<td align="left" valign="top" bgcolor="#a0ddf0">port+10</td>
<td align="left" valign="top" bgcolor="#a0ddf0">Max port used to listen.</td>
</tr>
<tr>
<td align="middle" valign="top" bgcolor="#039acc" colspan="2">channelUnix</td>
<td align="left" valign="top" bgcolor="#a0ddf0">A AF_UNIX socket communication transport from a local Web Server.</td>
</tr>
<tr>
<td align="left" valign="top" bgcolor="#a0ddf0">file</td>
<td align="left" valign="top" bgcolor="#a0ddf0">No default value</td>
<td align="left" valign="top" bgcolor="#a0ddf0">
    Name of the "file" associate with the socket.
    That must be absolut path name.
  </td>
</tr>
<tr>
<td align="middle" valign="top" bgcolor="#039acc" colspan="2">channelJni</td>
<td align="left" valign="top" bgcolor="#a0ddf0">A in Web Server process communication.</td>
</tr>
<tr>
<td align="middle" valign="top" bgcolor="#039acc" colspan="2">mx</td>
<td align="left" valign="top" bgcolor="#a0ddf0">mx4j adapter.</td>
</tr>
<tr>
<td align="left" valign="top" bgcolor="#a0ddf0">port</td>
<td align="left" valign="top" bgcolor="#a0ddf0">-1 (Disabled)</td>
<td align="left" valign="top" bgcolor="#a0ddf0">Port Number.</td>
</tr>
<tr>
<td align="middle" valign="top" bgcolor="#039acc" colspan="2">shm</td>
<td align="left" valign="top" bgcolor="#a0ddf0">shared memory objects handler.</td>
</tr>
<tr>
<td align="left" valign="top" bgcolor="#a0ddf0">file</td>
<td align="left" valign="top" bgcolor="#a0ddf0">/tmp/shm.file</td>
<td align="left" valign="top" bgcolor="#a0ddf0">Shared memory file.</td>
</tr>
<tr>
<td align="left" valign="top" bgcolor="#a0ddf0">host</td>
<td align="left" valign="top" bgcolor="#a0ddf0">localhost</td>
<td align="left" valign="top" bgcolor="#a0ddf0">Host name.</td>
</tr>
<tr>
<td align="left" valign="top" bgcolor="#a0ddf0">port</td>
<td align="left" valign="top" bgcolor="#a0ddf0">8009</td>
<td align="left" valign="top" bgcolor="#a0ddf0">Port number.</td>
</tr>
<tr>
<td align="left" valign="top" bgcolor="#a0ddf0">unixSocket</td>
<td align="left" valign="top" bgcolor="#a0ddf0">No default value</td>
<td align="left" valign="top" bgcolor="#a0ddf0">Unix socket where tomcat is listening.</td>
</tr>
</table>
</p>
<br/>
<a name="Examples">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="left" valign="top" class="section" bgcolor="#525D76">
<img border="0" vspace="0" hspace="0" align="left" valign="top" src="../images/corner.gif"/>Examples</td>
</tr>
</table>
</a>
<p class="section">
The examples below are working when the Web Server is configured according the 
examples described in the configweb file.
</p>
<a name="sub_using normal socket">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="left" valign="top" class="subsection" bgcolor="#828DA6">
<img border="0" vspace="0" hspace="0" align="left" valign="top" src="../images/corner.gif"/>using normal socket</td>
</tr>
</table>
</a>
<p class="section">
There is no need to use the jkjni logic to use normal socket, so that just for
Fun.
</p>
<p class="section">
<pre class="section">
# list of needed handlers.
handler.list=apr,channelSocket,request

# Override the default port for the channelSocket
channelSocket.port=8019

# Dynamic library
apr.NativeSo=/home1/jakarta/jakarta-tomcat-connectors/jk/build/jk2/apache2/jkjni.so
</pre>
</p>
<br/>
<a name="sub_using AF_UNIX socket">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="left" valign="top" class="subsection" bgcolor="#828DA6">
<img border="0" vspace="0" hspace="0" align="left" valign="top" src="../images/corner.gif"/>using AF_UNIX socket</td>
</tr>
</table>
</a>
<p class="section">
Create and listen on a AF_UNIX socket. The location of the socket must be the
same in the Web Server configuration file.
</p>
<p class="section">
<pre class="section">
# list of needed handlers.
handler.list=apr,channelUnix,request

# Location of the socket.
channelUnix.file=${jkHome}/work/jk2.socket

# Dynamic library
jtc=/home1/jakarta/jakarta-tomcat-connectors
apr.NativeSo=${jtc}/jk/build/jk2/apache2/jkjni.so
</pre>
</p>
<br/>
<a name="sub_using user defined class for communication">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="left" valign="top" class="subsection" bgcolor="#828DA6">
<img border="0" vspace="0" hspace="0" align="left" valign="top" src="../images/corner.gif"/>using user defined class for communication</td>
</tr>
</table>
</a>
<p class="section">
It is possible to have a user defined class for the communication.
Here we have used the ChannelUn as example.
</p>
<p class="section">
<pre class="section">
# Define our own handler.
class.mychannel=org.apache.jk.common.ChannelUn
# list of needed handlers.
handler.list=apr,mychannel,request

# Location of the socket.
channelUnix.file=${jkHome}/work/jk2.socket

# Dynamic library
jtc=/home1/jakarta/jakarta-tomcat-connectors
apr.NativeSo=${jtc}/jk/build/jk2/apache2/jkjni.so
</pre>
</p>
<br/>
<a name="sub_using jni channel class for communication">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="left" valign="top" class="subsection" bgcolor="#828DA6">
<img border="0" vspace="0" hspace="0" align="left" valign="top" src="../images/corner.gif"/>using jni channel class for communication</td>
</tr>
</table>
</a>
<p class="section">
Here we have the minimum configuration needed for the jni communication.
</p>
<p class="section">
<pre class="section">
# list of needed handlers.
handler.list=apr,request,channelJni

# Dynamic library needs to be defined only if Tomcat is used
# out of process
jtc=/home1/jakarta/jakarta-tomcat-connectors
apr.NativeSo=${jtc}/jk/build/jk2/apache2/jkjni.so
# Or you can use the mod_jk2 directly
apr.jniModeSo=/opt/apache2/modules/mod_jk2.so

# If you wish to start the Tomcat from inside web server then
# you don't need any above directive. Here is shown the default
# value for the apr that you can ommit
apr.jniModeSo=inprocess

</pre>
</p>
<br/>
<br/>
</td>
</tr>
</table>
</body>
</html>
